#include <stdio.h>
#include <string.h>

int main(int argc, char const *argv[])
{
    char a[5], b[5];
    int bull = 0, cow = 0;
    scanf("%s%s", a, b);

    for (int i = 0; i < 4; i++)
        if (strchr(a, b[i]) != NULL)
            cow++;
    for (int i = 0; i < 4; i++)
        if (a[i] == b[i])
            bull++;
    printf("%d %d\n", bull, cow - bull);
    return 0;
}
